/**
 * Copyright (C) 2025-2025. Huawei Technologies Co., Ltd. All rights reserved.
 * Licensed to the Apache Software Foundation (ASF) under one
 * or more contributor license agreements.  See the NOTICE file
 * distributed with this work for additional information
 * regarding copyright ownership.  The ASF licenses this file
 * to you under the Apache License, Version 2.0 (the
 * "License"); you may not use this file except in compliance
 * with the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#include <jni.h>
#include <vector/vector_common.h>

#include "vec_data.pb.h"

#ifndef SPARK_JNI_DESERIALIZER
#define SPARK_JNI_DESERIALIZER
#ifdef __cplusplus
extern "C" {
#endif

JNIEXPORT void JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseBatch(
    JNIEnv *env, jobject obj, jlong address, jintArray typeIdArray, jintArray precisionArray,
    jintArray scaleArray, jlongArray vecNativeIdArray);

JNIEXPORT jlong JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseInit(
    JNIEnv *env, jobject obj, jlong address, jint length);

JNIEXPORT void JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseClose(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT jint JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseVecCount(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT jint JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseRowCount(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT void JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_columnarShuffleParseColumnarBatch(
    JNIEnv *env, jobject obj, jlong address, jintArray typeIdArray, jintArray precisionArray,
    jintArray scaleArray, jlongArray vecNativeIdArray);

JNIEXPORT jlong JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_rowShuffleParseInit(
    JNIEnv *env, jobject obj, jlong address, jint length);

JNIEXPORT void JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_rowShuffleParseClose(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT jint JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_rowShuffleParseVecCount(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT jint JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_rowShuffleParseRowCount(
    JNIEnv *env, jobject obj, jlong address);

JNIEXPORT void JNICALL
Java_com_huawei_boostkit_spark_serialize_ShuffleDataSerializerUtils_rowShuffleParseBatch(
    JNIEnv *env, jobject obj, jlong address, jintArray typeIdArray, jintArray precisionArray,
    jintArray scaleArray, jlongArray vecNativeIdArray);


#ifdef __cplusplus
}
#endif
#endif
